src := $(wildcard *.c)
obj := $(src:%.c=%.o)
dep := $(src:%.c=.%.o.cmd)
curl: $(obj)
	gcc -o $@ $(obj) -lcurl -lpthread

-include $(dep)

$(dep):.%.o.cmd:%.c
		  @rm $@ -f;
		  @gcc -M $< | sed 's/^\(.*\):/$@ \1:/' > $@;

#%.o: %.c
#	gcc -c -o $@ $< -ggdb

clean:
	rm $(obj) $(dep) curl -rf
install:
	@./install-sh
